﻿<div class="new-stuff">
  <!-- IF U_REPLY -->
  <span class="new-topic post-button"><a href="{U_REPLY}">{L_REPLY}</a></span>
  <!-- ENDIF -->
  <!-- IF U_FORWARD -->
	<span class="new-reply post-button"><a href="{U_FORWARD}">{L_FORWARD}</a></span>
  <!-- ENDIF -->
</div>

<script type="text/javascript">
<!--
    nid = {NEWEST_ID};
    var tid = {S_ID};
    lang['SEND_A_MESSAGE'] = '{L_SEND_A_MESSAGE}';

    $(document).ready(function () {
        resize();
        $('#message-text').keydown(function(event) {
            if (event.keyCode == 13) {
                if (!event.shiftKey && !event.altKey) {
                    $("#save").click();
                    return false;
                }
            }
        }).focus(function(){
            if ($(this).hasClass('blur')) {
                $(this).val('');
                $(this).removeClass('blur');
            }
        }).blur(function(){
            if ($(this).val() == '') {
                $(this).addClass('blur');
                $(this).val(lang['SEND_A_MESSAGE']);
            }
        }).trigger('blur');
        $('.comment-buttons').hide();

        setInterval(checkNewMessagesInThread, 20000);
    });

    $(window).resize(function () {
        resize();
    });

    function resize() {
        <!-- IF $_IS_MOBILE -->
        $(document).scrollTop($('#posts').prop("scrollHeight"));
        <!-- ELSE -->
        $('#posts').css("overflow-y", "scroll").css("float", "none").css("height", $(window).height() - $('#posts').offset().top - $('#footer').outerHeight(true) - $('.mail-reply-form').outerHeight(true) - 40).scrollTop($('#posts').prop("scrollHeight"));
        <!-- ENDIF -->
    }
-->
</script>

<h2>
  <!-- BEGIN recipients -->
  <!-- IF recipients.IS_ONLINE -->
  <span class="online"></span>
  <!-- ENDIF -->
  {recipients.DISPLAY_NAME}
  <!-- END recipients -->
</h2>
<ul id="posts">
<!-- INCLUDE pane_message -->
</ul>

<form action="{U_ACCOUNT}" method="post" class="mail-reply-form" onsubmit="return false;">
<fieldset>
        <div class="message-text">
	        <textarea id="message-text" class="comment-textarea blur" name="message" style="width: 100%; height: 56px;" rows="3" cols="75"></textarea>
	        <p style="text-align: right;" class="comment-buttons"><input type="submit" id="save" name="save" value="Reply" class="comment-submit" onclick="return SendMessage({S_ID}, $(this).parent().siblings('.comment-textarea').val());" />
            <input type="reset" value="Cancel" /></p>
		<input type="hidden" name="module" value="mail" />
		<input type="hidden" name="sub" value="compose" />
        <input type="hidden" name="mode" value="reply" />
		<input type="hidden" name="id" value="{S_ID}" />
        </div>
</fieldset>
</form>